package com.sali.design_pattern.d_strategy_pattern.lesson_02;

import com.sali.design_pattern.d_strategy_pattern.lesson_02.strategy.IPayService;

/**
 * @description:
 * @author: zhang hang
 * @date: 2023/3/26 13:31.
 * @version: 1.0
 */
public class Lesson02Starter {

    public static void main(String[] args) {

        IPayService weixinPay = com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.getPayInstance(com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.WEIXIN_PAY);
        System.out.println(weixinPay.getPayName());
        weixinPay.payVip(1);
        weixinPay.payNews(1L);
        weixinPay.payCourse(1L);

        IPayService aliPay = com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.getPayInstance(com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.ALI_PAY);
        System.out.println(aliPay.getPayName());
        aliPay.payVip(1);
        aliPay.payNews(1L);
        aliPay.payCourse(1L);

        IPayService bankPayService = com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.getPayInstance(com.sali.design_pattern.d_strategy_pattern.lesson_02.PayStrategyFactory.BANK_PAY);
        System.out.println(bankPayService.getPayName());
        bankPayService.payVip(1);
        bankPayService.payNews(1L);
        bankPayService.payCourse(1L);
    }

}
